#include<stdio.h>
#include<string.h>

int main()
{
	int n,m,a[100],i,j,sum;
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		sum=0;
		memset(a,0,sizeof(a));
		scanf("%d",&m);
		for (j=0;j<m;j++)
			scanf("%d",&a[j]);
		sum=a[0]*6+5;
		for (j=1;j<m;j++)
		{
			if (a[j]>a[j-1])
				sum+=(a[j]-a[j-1])*6+5;
			else
				sum+=(a[j-1]-a[j])*4+5;
		}
		printf("%d\n",sum);
	}
	return 0;
}
